

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
        <style type="text/css">
            <!--
            body{ margin:0px;}
            #ordersuccess{ color:#FF0000; border:1px solid #93D900; padding:5px; margin-bottom:2px; font-size:14px;}
            form{margin:0px;}
            -->
        </style>
    </head>

    <body>
        <form action="/order/cart?cmd=modify" method="post" name="form1" target="UserShop_iframe">
            <table border="1" width="100%" bordercolor="#CEE3D0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin:0px; padding:0px;">
                <tr>
                    <td width="100%" align="center">
                        <table  width="100%" height="92" cellspacing="1" cellpadding="1" >
                            <tr BGCOLOR=#CEE3D0 >
                                <td WIDTH=600 height="28" align="center"></td>
                                <td WIDTH=600 height="28" align="center"><font size="2">编&nbsp;号</font></td>
                                <td WIDTH=600 height="28" align="center"><font size="2">产&nbsp;品&nbsp; 名&nbsp; 称</font></td>
                                <td WIDTH=600 height="28" align="center"><font size="2">数量</font></td>
                                <td WIDTH=600 height="28" align="center"><font size="2">单价</font></td>
                                <td WIDTH=600 height="28" align="center"><font size="2">总价</font></td>
                                <td width=600 height="28" align="center"><font size="2">删除</font></td>
                            </tr>
                            <?php $totalPrice = 0; ?>
                            <?php foreach ($this->carts as $cart): ?>

                                <tr bgcolor="#EAF7EC" align="center">
                                    <td width="600" height="1" >
                                        <img src="<?php echo "/upload/" . $cart->getProductID() ?>" width="40" alt="image" onerror="this.src='/images/nopic.gif'" /></td>
                                    <td width="600" height="1" align="center"><?php echo $cart->getProductID() ?></td>
                                    <td width="600" height="1" ><?php echo $cart->getProductName() ?></td>
                                    <td width="600" height="1" >
                                        <input type="text" name="num[]" value="<?php echo $cart->getNumber() ?>" size="2" maxlength="5" />
                                    </td>
                                    <td width="600" height="1" ><?php echo $cart->getPrice() ?></td>
                                    <td width="600" height="1" >
                                    <?php
                                    $price = $cart->getNumber() * $cart->getPrice();
                                    $totalPrice = $price + $totalPrice;
                                    echo ($price);
                                    ?>
                                </td>
                                <td width="600" height="1" ><a href="<?php echo "/order/cart?cmd=delete&id=" . $cart->getProductID() ?>" target="UserShop_iframe">删除</a></td>
                            </tr>
                            <?php endforeach; ?>
                                    <tr bgcolor="#EAF7EC">
                                        <td colspan="9" width="600" height="28" align="right">
                                            合计:￥<?php echo $totalPrice ?>
                                    <input type="submit" name="modify" value="修改订单" />
                                    <input type="button" name="clear" value="清空购物车" onclick="clearShop()" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <br />
        </form>
        <script language="javascript">
            parent.displayDiv('loadingiframe', false);
            function clearShop() {
                document.form1.action = '/order/cart?cmd=clear';
                document.form1.submit();
            }
        </script>
    </body>
</html>